package vista;
import java.awt.BorderLayout;
import java.awt.LayoutManager;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaArbitro extends javax.swing.JFrame {
	
	private JPanel panArbitro;
	private JTextField txtCedArbitro;
	private JTextField txtNombArbitro;
	private JLabel lblDatosA;
	private JButton btnRegistrar;
	private JTextField txtFechaNac;
	private JLabel lblFechaNac;
	private JTextField txtApellido;
	private JLabel lblApellido;
	private JLabel lblNombArbitro;
	private JLabel lblCedArbitro;


	
	public VentanaArbitro() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setBackground(new java.awt.Color(255,255,255));
			this.setTitle("Registro de Arbitro");
			{
				panArbitro = new JPanel();
				getContentPane().add(panArbitro, BorderLayout.CENTER);
				panArbitro.setLayout(null);
				LayoutManager panArbitroLayout = null;
				panArbitro.setLayout(panArbitroLayout);
				{
					lblCedArbitro = new JLabel();
					panArbitro.add(lblCedArbitro);
					lblCedArbitro.setText("Cédula del Arbitro:");
					lblCedArbitro.setBounds(160, 22, 144, 19);
				}
				{
					txtCedArbitro = new JTextField();
					panArbitro.add(txtCedArbitro);
					txtCedArbitro.setBounds(322, 19, 96, 22);
				}
				{
					lblNombArbitro = new JLabel();
					panArbitro.add(lblNombArbitro);
					lblNombArbitro.setBounds(12, 93, 96, 15);
					lblNombArbitro.setText("Nombre:");
				}
				{
					txtNombArbitro = new JTextField();
					panArbitro.add(txtNombArbitro);
					txtNombArbitro.setBounds(120, 90, 179, 22);
				}
				{
					lblApellido = new JLabel();
					panArbitro.add(lblApellido);
					lblApellido.setText("Apellido:");
					lblApellido.setBounds(12, 137, 74, 15);
				}
				{
					txtApellido = new JTextField();
					panArbitro.add(txtApellido);
					txtApellido.setBounds(120, 134, 179, 23);
				}
				{
					lblFechaNac = new JLabel();
					panArbitro.add(lblFechaNac);
					lblFechaNac.setText("Fecha de Nacimiento:");
					lblFechaNac.setBounds(14, 179, 171, 15);
				}
				{
					txtFechaNac = new JTextField();
					panArbitro.add(txtFechaNac);
					txtFechaNac.setBounds(197, 176, 102, 22);
				}
				{
					btnRegistrar = new JButton();
					panArbitro.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(189, 234, 104, 29);
				}
				{
					lblDatosA = new JLabel();
					panArbitro.add(lblDatosA);
					lblDatosA.setBounds(38, 53, 370, 25);
				}
			}
			pack();
			this.setSize(436, 304);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public String getCedula(){
		return txtCedArbitro.getText();
	}
	
	public String getNombre(){
		return txtNombArbitro.getText();
	}
	
	public String getApellido(){
		return txtApellido.getText();
	}
	
	public String getfecNac(){
		return txtFechaNac.getText();
	}
	/*public String getcanPartArbit(){
		return txtCantidadPart.getText();// como transformar en String
	}
	*/
	public void mostrarMensaje(String mensaje){
		JOptionPane.showMessageDialog(this, mensaje);
	}
	public void mostrarDatos(String datos)	
	{
		lblDatosA.setText(datos);
	}
	public void agregarListener(ActionListener accion){
	   btnRegistrar.addActionListener(accion);
	}
	
	public void blanquearCampos(){
		txtCedArbitro.setText("");
	    txtNombArbitro.setText("");
	    txtApellido.setText("");
	    txtFechaNac.setText("");
	    //txtCantidadPart.setText("");
	    
	    
	}

/*	public void mostrarDatos(String datos) {
		lblDatos.setText(datos);// debo crear un lbl de datps/ ejercico 2A
		// TODO Auto-generated method stub
		
	}*/
	
}
